package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/2 17:58
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class YunXinEventPoJo implements IGetKey<Long> {

    public static final String CACHE_NAME = "yun_xin_event";

    @Serial
    private static final long serialVersionUID = -6363198444781420359L;

    @QuerySqlField(name = "id", index = true)
    private Long id;

    /**
     * 被拉入黑名单的用户
     */
    @QuerySqlField(name = "content")
    private String content;

    @QuerySqlField(name = "handled")
    private boolean handled;

    @QuerySqlField(name = "handle_error")
    private String handleError;

    @QuerySqlField(name = "create_time")
    private Timestamp createTime;

    @QuerySqlField(name = "version")
    private Long version;

    @JsonIgnore
    private boolean insert;

    @Override
    public Long getKey() {
        return id;
    }
}

